@extends('bootstrap')
@section('title','上传图片')
@section('content')
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <form enctype="multipart/form-data" action="{{url('uploadimage')}}" method="post">
                {!! csrf_field() !!}
                <div class="form-group">
                    <label for="imgtxtid">图片文字</label>
                    <input type="text" class="form-control" id="imgtxtid" name="imgtxt" value="{{ old('imgtxt') }}"
                           placeholder="请输入图片文字（必须)">
                </div>
                @if(count($errors)>0&&count($errors->get('imgtxt')))
                    <div class="alert alert-danger">
                        <ul>
                            @foreach($errors->get('imgtxt') as $error)
                                <li>{{$error}}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif

                <div class="form-group">
                    <label for="fileid">选择上传文件</label>
                    <input type="file" id="fileid" name="imgfile" value="{{old('imgifle')}}">

                    <p class="help-block">单击上面按钮可以选择要上传的图片文件(只支持BMP、JPG、GIF、PNG、SVG格式，最大为16M)</p>
                </div>

                @if(count($errors)>0&&count($errors->get('imgfile')))
                    <div class="alert alert-danger">
                        <ul>
                            @foreach($errors->get('imgfile') as $error)
                                <li>{{$error}}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif

                <button type="submit" class="btn btn-block btn-primary">上传文件</button>
            </form>
        </div>
    </div>
@endsection